#hangman
import random
wordbank = ['pony','submarine','bird','chocolate']
word=random.choice(wordbank)
print word
length=len(word)
dasharray=list(length*"-")
wordarray=list(word)
print dasharray
print wordarray
i=0
guess=raw_input("Guess a letter")
lives=5
while lives>0:
        while i<length:
            if wordarray[i] == guess:
                dasharray[i] = guess
                i = i+1
            else:
                i = i+1
                lives-1
print dasharray
print "You have",lives,"lives left."
